package com.hpq.websocket.service;

import com.hpq.websocket.domain.vo.response.WSBaseResp;
import io.netty.channel.Channel;

public interface WebSocketService {
    // 连接websocket
    void connect(Channel ctx);
    // 处理登录请求
    void handlerLoginReq(Channel channel);
    // 移除通道
    void remove(Channel channel);
    // 扫码登录成功
    void  scanLoginSuccess(Integer loginCode, Long uid);
    // 等待授权
    void waitAuthorize(Integer code);

    void authorize(Channel channel, String token);
    void sendMsgToAll(WSBaseResp<?> resp);
    // 发送消息到指定用户
    void sendToUid(WSBaseResp<?> wsBaseMsg, Long uid);
    // 发送消息到所有在线用户
    void sendToAllOnline(WSBaseResp<?> wsBaseMsg,Long uid);

    Boolean scanSuccess(Integer code);
}
